package com.juyu.miliao.api.rabbitMQ;

import com.alibaba.fastjson.JSONObject;
import com.juyu.miliao.api.domain.PicCheck;

import com.juyu.miliao.common.constant.enumMQKey.EnumTypeMQ;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class PicCheckRabbitMQ {
    @Resource
    private AmqpTemplate amqpTemplate;

    public void timeDelaySavePicCheck(PicCheck picCheck){
        JSONObject json = new JSONObject();
        String temp = json.toJSONString(picCheck);
        amqpTemplate.convertAndSend(EnumTypeMQ.Pic_Check_Time_Delay_Save.exchange,
                EnumTypeMQ.Pic_Check_Time_Delay_Save.routingKey,temp);
    }

}
